package com.nachuan.pdd.internal;

import cn.hutool.http.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 消息推送工具类
 *
 * @author : 古书柳
 * @date : 07 : 02 : 2025/2/7
 */
@Slf4j
@Component
public class SendMessageUtil {

	@Async
	public void sendMessage(String message, String url) {
		String result = null;
		try {
			result = HttpUtil.post(url, message);
		} catch (Exception e) {
			log.error("发送消息失败 -> {}", e.getMessage());
		}

		log.info("发送消息成功 -> {}", result);
	}
}
